//=============================================================================
// LevelValueList.as
// 
// 
// AUTHOR:            Jay Liang
// 
//                  Copyright (c) 2011 Break Media
//                              All Rights Reserved.
//                          
//=============================================================================
package values.level
{
import com.adobe.utils.DictionaryUtil;

import flash.utils.Dictionary;

public class AvatarLevelValueList
{	
	private static var list:Dictionary; /* LevelValue */
	
	private static var _maxLevel:int = 0;

	public static function get maxLevel():int
	{
		return _maxLevel;
	}
	
	public function get levels():Dictionary
	{
		return list;
	}
	
	[Data(type="mapping", 
		   mapping="level", 
		   ref="values.level.LevelValue",
		   way="one_to_more",
		   object="flash.utils.Dictionary",
           key="@value")]
	public function set levels(value:Dictionary):void
	{
		list = value;
		var arr:Array = DictionaryUtil.getValues(list);
		_maxLevel = arr.length;
	}
	
	public static function get levelList():Dictionary
	{
		return list;
	}
	
	public static function getByLevel(level:int):LevelValue
	{
		return list[String(level)];
	}
}
}



